package com.fy.sys.controller;

import com.fy.core.dto.PageDto;
import com.fy.core.vo.ApiRest;
import com.fy.core.vo.PageResult;
import com.fy.sys.dto.RoleAddDto;
import com.fy.sys.entity.Role;
import com.fy.sys.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 角色信息表 前端控制器
 * </p>
 *
 * @author hxd
 * @since 2023-06-14
 */
@RestController
@CrossOrigin
@RequestMapping("/role")
public class RoleController {
    @Autowired
    private RoleService roleService;
    @PostMapping("/page")
    public PageResult<Role> page(@RequestBody PageDto<Role> pageDto){
        return roleService.pageFind(pageDto);
    }

    @PostMapping("/create")
    public ApiRest create(@RequestBody RoleAddDto roleAddDto){
      return roleService.save(roleAddDto);
    };


}
